package com.wanger.swa.service.ise;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wanger.swc.util.template.FileData;
import com.wanger.swa.dto.buildRecord.query.BuildRecordQuery;
import com.wanger.swa.dto.buildRecord.req.model.BuildReq;
import com.wanger.swa.dto.buildRecord.req.BuildRecordAddReq;
import com.wanger.swa.dto.buildRecord.req.BuildRecordUpdateReq;
import com.wanger.swa.dto.buildRecord.resp.BuildRecordResp;
import com.wanger.swa.domain.po.BuildRecordPO;

import java.io.OutputStream;
import java.util.List;

/**
 * @Author: wanger
 * @Date: 2024/9/15 12:57
 * @Description: 构建记录
 */
public interface BuildRecordService extends IService<BuildRecordPO> {

    BuildRecordResp addBuildRecord(BuildRecordAddReq addDTO);

    BuildRecordResp updateBuildRecord(BuildRecordUpdateReq updateDTO);

    BuildRecordResp getOneBuildRecord(String id);

    IPage<BuildRecordResp> pageBuildRecord(BuildRecordQuery query);

    List<BuildRecordResp> listBuildRecord(BuildRecordQuery query);

    void deleteBuildRecord(String id);

    /**
     * 提交预览支持
     *
     * @param bu 构建配置
     * @return 构造好的文件
     */
    FileData buildPreview(BuildReq bu);

    /**
     * 把构造好的内容转换为zip压缩包
     *
     * @param bu  构建配置
     * @param out 输出流
     */
    void buildZip(BuildReq bu, OutputStream out);

}
